home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / flex_247.zip / flex_247 / configure < prev    next >
Text File  |  1994-01-04  |  20KB  |  777 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf version 1.7.1 
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  93. echo > confdefs.h
  94. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  95.  
  96. # A filename unique to this package, relative to the directory that
  97. # configure is in, which we can look for to find out if srcdir is correct.
  98. unique_file=initscan.c
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.  
  131.  
  132. echo checking for ln -s
  133. rm -f conftestdata
  134. if ln -s X conftestdata 2>/dev/null
  135. then
  136.   rm -f conftestdata
  137.   LN_S="ln -s"
  138. else
  139.   LN_S=ln
  140. fi
  141.  
  142.  
  143. for p in 'bison -y' byacc
  144. do
  145. if test -z "$YACC"; then
  146.   # Extract the first word of `$p', so it can be a program name with args.
  147.   set dummy $p; word=$2
  148.   echo checking for $word
  149.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  150.   for dir in $PATH; do
  151.     test -z "$dir" && dir=.
  152.     if test -f $dir/$word; then
  153.       YACC="$p"
  154.       break
  155.     fi
  156.   done
  157.   IFS="$saveifs"
  158. fi
  159.  
  160. test -n "$YACC" && test -n "$verbose" && echo "    setting YACC to $YACC"
  161.  
  162. test -n "$YACC" && break
  163. done
  164. test -n "$YACC" || YACC="yacc"
  165.  
  166. if test -z "$CC"; then
  167.   # Extract the first word of `gcc', so it can be a program name with args.
  168.   set dummy gcc; word=$2
  169.   echo checking for $word
  170.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  171.   for dir in $PATH; do
  172.     test -z "$dir" && dir=.
  173.     if test -f $dir/$word; then
  174.       CC="gcc"
  175.       break
  176.     fi
  177.   done
  178.   IFS="$saveifs"
  179. fi
  180. test -z "$CC" && CC="cc"
  181. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  182.  
  183. # Find out if we are using GNU C, under whatever name.
  184. cat > conftest.c <<EOF
  185. #ifdef __GNUC__
  186.   yes
  187. #endif
  188. EOF
  189. ${CC-cc} -E conftest.c > conftest.out 2>&1
  190. if egrep yes conftest.out >/dev/null 2>&1; then
  191.   GCC=1 # For later tests.
  192. fi
  193. rm -f conftest*
  194.  
  195. if test -z "$RANLIB"; then
  196.   # Extract the first word of `ranlib', so it can be a program name with args.
  197.   set dummy ranlib; word=$2
  198.   echo checking for $word
  199.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  200.   for dir in $PATH; do
  201.     test -z "$dir" && dir=.
  202.     if test -f $dir/$word; then
  203.       RANLIB="ranlib"
  204.       break
  205.     fi
  206.   done
  207.   IFS="$saveifs"
  208. fi
  209. test -z "$RANLIB" && RANLIB=":"
  210. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  211.  
  212. # Make sure to not get the incompatible SysV /etc/install and
  213. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  214. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  215. # or the AFS install, which mishandles nonexistent args, or
  216. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  217. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  218. # anyway.  Sigh.
  219. if test "z${INSTALL}" = "z" ; then
  220.   echo checking for install
  221.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  222.   for dir in $PATH; do
  223.     test -z "$dir" && dir=.
  224.     case $dir in
  225.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  226.     *)
  227.       if test -f $dir/installbsd; then
  228.     INSTALL="$dir/installbsd -c" # OSF1
  229.     INSTALL_PROGRAM='$(INSTALL)'
  230.     INSTALL_DATA='$(INSTALL) -m 644'
  231.     break
  232.       fi
  233.       if test -f $dir/install; then
  234.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  235.       : # AIX
  236.     else
  237.       INSTALL="$dir/install -c"
  238.       INSTALL_PROGRAM='$(INSTALL)'
  239.       INSTALL_DATA='$(INSTALL) -m 644'
  240.       break
  241.     fi
  242.       fi
  243.       ;;
  244.     esac
  245.   done
  246.   IFS="$saveifs"
  247. fi
  248. if test -z "$INSTALL"; then
  249.   if test -f ${srcdir}/install.sh; then
  250.     # We want the top-level source directory, not the subdir's srcdir,
  251.     # so expand srcdir now rather than in the Makefile.
  252.     INSTALL="${srcdir}/install.sh -c"
  253.   else
  254.     echo "warning: ${srcdir}/install.sh not found; using cp"
  255.     INSTALL=cp
  256.   fi
  257. fi
  258. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  259. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  260. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  261. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  262. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  263.  
  264. prog='/* Ultrix mips cc rejects this.  */
  265. typedef int charset[2]; const charset x;
  266. /* SunOS 4.1.1 cc rejects this.  */
  267. char const *const *ccp;
  268. char **p;
  269. /* AIX XL C 1.02.0.0 rejects this.
  270.    It does not let you subtract one const X* pointer from another in an arm
  271.    of an if-expression whose if-part is not a constant expression */
  272. const char *g = "string";
  273. ccp = &g + (g ? g-g : 0);
  274. /* HPUX 7.0 cc rejects these. */
  275. ++ccp;
  276. p = (char**) ccp;
  277. ccp = (char const *const *) p;
  278. { /* SCO 3.2v4 cc rejects this.  */
  279.   char *t;
  280.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  281.  
  282.   *t++ = 0;
  283. }
  284. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  285.   int x[] = {25,17};
  286.   const int *foo = &x[0];
  287.   ++foo;
  288. }
  289. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  290.   typedef const int *iptr;
  291.   iptr p = 0;
  292.   ++p;
  293. }
  294. { /* AIX XL C 1.02.0.0 rejects this saying
  295.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  296.   struct s { int j; const int *ap[3]; };
  297.   struct s *b; b->j = 5;
  298. }
  299. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  300.   const int foo = 10;
  301. }'
  302. echo checking for lack of working const
  303. cat > conftest.c <<EOF
  304. #include "confdefs.h"
  305.  
  306. int main() { exit(0); }
  307. int t() { $prog }
  308. EOF
  309. if eval $compile; then
  310.   :
  311. else
  312.   rm -rf conftest*
  313.   
  314. {
  315. test -n "$verbose" && \
  316. echo "    defining" const to be empty
  317. echo "#define" const  >> confdefs.h
  318. DEFS="$DEFS -Dconst="
  319. }
  320.  
  321. fi
  322. rm -f conftest*
  323.  
  324. echo checking how to run the C preprocessor
  325. if test -z "$CPP"; then
  326.   # This must be in double quotes, not single quotes, because CPP may get
  327.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  328.   # make.  It must be expanded now.
  329.   CPP="${CC-cc} -E"
  330.   cat > conftest.c <<EOF
  331. #include "confdefs.h"
  332. #include <stdio.h>
  333. Syntax Error
  334. EOF
  335. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  336. if test -z "$err"; then
  337.   :
  338. else
  339.   rm -rf conftest*
  340.   CPP=/lib/cpp
  341. fi
  342. rm -f conftest*
  343. fi
  344. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  345.  
  346. echo checking for ANSI C header files
  347. cat > conftest.c <<EOF
  348. #include "confdefs.h"
  349. #include <stdlib.h>
  350. #include <stdarg.h>
  351. #include <string.h>
  352. #include <float.h>
  353. EOF
  354. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  355. if test -z "$err"; then
  356.   rm -rf conftest*
  357.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  358. echo '#include "confdefs.h"
  359. #include <string.h>' > conftest.c
  360. eval "$CPP conftest.c > conftest.out 2>&1"
  361. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  362.   rm -rf conftest*
  363.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  364. cat > conftest.c <<EOF
  365. #include "confdefs.h"
  366. #include <ctype.h>
  367. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  368. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  369. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  370. int main () { int i; for (i = 0; i < 256; i++)
  371. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  372. exit (0); }
  373.  
  374. EOF
  375. eval $compile
  376. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  377.   
  378. {
  379. test -n "$verbose" && \
  380. echo "    defining STDC_HEADERS"
  381. echo "#define" STDC_HEADERS 1 >> confdefs.h
  382. DEFS="$DEFS -DSTDC_HEADERS=1"
  383. }
  384.  
  385.  
  386. fi
  387. rm -fr conftest*
  388.  
  389. fi
  390. rm -f conftest*
  391.  
  392.  
  393. fi
  394. rm -f conftest*
  395.  
  396. for hdr in string.h
  397. do
  398. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  399. echo checking for ${hdr}
  400. cat > conftest.c <<EOF
  401. #include "confdefs.h"
  402. #include <${hdr}>
  403. EOF
  404. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  405. if test -z "$err"; then
  406.   rm -rf conftest*
  407.   
  408. {
  409. test -n "$verbose" && \
  410. echo "    defining ${trhdr}"
  411. echo "#define" ${trhdr} 1 >> confdefs.h
  412. DEFS="$DEFS -D${trhdr}=1"
  413. }
  414.  
  415.  
  416. fi
  417. rm -f conftest*
  418. done
  419.  
  420.  
  421. case "$YACC" in
  422. *bison*)
  423.   # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  424. # for constant arguments.  Useless!
  425. echo checking for working alloca.h
  426. cat > conftest.c <<EOF
  427. #include "confdefs.h"
  428. #include <alloca.h>
  429. int main() { exit(0); }
  430. int t() { char *p = alloca(2 * sizeof(int)); }
  431. EOF
  432. if eval $compile; then
  433.   rm -rf conftest*
  434.   
  435. {
  436. test -n "$verbose" && \
  437. echo "    defining HAVE_ALLOCA_H"
  438. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  439. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  440. }
  441.  
  442.  
  443. fi
  444. rm -f conftest*
  445.  
  446. decl="#ifdef __GNUC__
  447. #define alloca __builtin_alloca
  448. #else
  449. #if HAVE_ALLOCA_H
  450. #include <alloca.h>
  451. #else
  452. #ifdef _AIX
  453.  #pragma alloca
  454. #else
  455. char *alloca ();
  456. #endif
  457. #endif
  458. #endif
  459. "
  460. echo checking for alloca
  461. cat > conftest.c <<EOF
  462. #include "confdefs.h"
  463. $decl
  464. int main() { exit(0); }
  465. int t() { char *p = (char *) alloca(1); }
  466. EOF
  467. if eval $compile; then
  468.   :
  469. else
  470.   rm -rf conftest*
  471.   alloca_missing=1
  472. cat > conftest.c <<EOF
  473. #include "confdefs.h"
  474.  
  475. #if defined(CRAY) && ! defined(CRAY2)
  476. winnitude
  477. #else
  478. lossage
  479. #endif
  480.  
  481. EOF
  482. eval "$CPP conftest.c > conftest.out 2>&1"
  483. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  484.   rm -rf conftest*
  485.   echo checking for _getb67
  486. cat > conftest.c <<EOF
  487. #include "confdefs.h"
  488. #include <ctype.h>
  489. int main() { exit(0); }
  490. int t() { 
  491. /* The GNU C library defines this for functions which it implements
  492.     to always fail with ENOSYS.  Some functions are actually named
  493.     something starting with __ and the normal name is an alias.  */
  494. #if defined (__stub__getb67) || defined (__stub____getb67)
  495. choke me
  496. #else
  497. /* Override any gcc2 internal prototype to avoid an error.  */
  498. extern char _getb67(); _getb67();
  499. #endif
  500.  }
  501. EOF
  502. if eval $compile; then
  503.   rm -rf conftest*
  504.   {
  505. test -n "$verbose" && \
  506. echo "    defining" CRAY_STACKSEG_END to be _getb67
  507. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  508. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  509. }
  510.  
  511.  
  512. else
  513.   rm -rf conftest*
  514.   echo checking for GETB67
  515. cat > conftest.c <<EOF
  516. #include "confdefs.h"
  517. #include <ctype.h>
  518. int main() { exit(0); }
  519. int t() { 
  520. /* The GNU C library defines this for functions which it implements
  521.     to always fail with ENOSYS.  Some functions are actually named
  522.     something starting with __ and the normal name is an alias.  */
  523. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  524. choke me
  525. #else
  526. /* Override any gcc2 internal prototype to avoid an error.  */
  527. extern char GETB67(); GETB67();
  528. #endif
  529.  }
  530. EOF
  531. if eval $compile; then
  532.   rm -rf conftest*
  533.   {
  534. test -n "$verbose" && \
  535. echo "    defining" CRAY_STACKSEG_END to be GETB67
  536. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  537. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  538. }
  539.  
  540.  
  541. else
  542.   rm -rf conftest*
  543.   echo checking for getb67
  544. cat > conftest.c <<EOF
  545. #include "confdefs.h"
  546. #include <ctype.h>
  547. int main() { exit(0); }
  548. int t() { 
  549. /* The GNU C library defines this for functions which it implements
  550.     to always fail with ENOSYS.  Some functions are actually named
  551.     something starting with __ and the normal name is an alias.  */
  552. #if defined (__stub_getb67) || defined (__stub___getb67)
  553. choke me
  554. #else
  555. /* Override any gcc2 internal prototype to avoid an error.  */
  556. extern char getb67(); getb67();
  557. #endif
  558.  }
  559. EOF
  560. if eval $compile; then
  561.   rm -rf conftest*
  562.   {
  563. test -n "$verbose" && \
  564. echo "    defining" CRAY_STACKSEG_END to be getb67
  565. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  566. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  567. }
  568.  
  569.  
  570. fi
  571. rm -f conftest*
  572.  
  573. fi
  574. rm -f conftest*
  575.  
  576. fi
  577. rm -f conftest*
  578.  
  579.  
  580. fi
  581. rm -f conftest*
  582.  
  583.  
  584. fi
  585. rm -f conftest*
  586.  
  587. if test -n "$alloca_missing"; then
  588.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  589.   # that cause trouble.  Some versions do not even contain alloca or
  590.   # contain a buggy version.  If you still want to use their alloca,
  591.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  592.   ALLOCA=alloca.o
  593.   
  594. {
  595. test -n "$verbose" && \
  596. echo "    defining C_ALLOCA"
  597. echo "#define" C_ALLOCA 1 >> confdefs.h
  598. DEFS="$DEFS -DC_ALLOCA=1"
  599. }
  600.  
  601.  
  602.   echo 'checking stack direction for C alloca'
  603.   echo checking whether cross-compiling
  604. # If we cannot run a trivial program, we must be cross compiling.
  605. cat > conftest.c <<EOF
  606. #include "confdefs.h"
  607. main(){exit(0);}
  608. EOF
  609. eval $compile
  610. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  611.   :
  612. else
  613.   cross_compiling=1
  614. fi
  615. rm -fr conftest*
  616.  
  617. if test -n "$cross_compiling"
  618. then
  619.   
  620. {
  621. test -n "$verbose" && \
  622. echo "    defining" STACK_DIRECTION to be 0
  623. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  624. DEFS="$DEFS -DSTACK_DIRECTION=0"
  625. }
  626.  
  627. else
  628. cat > conftest.c <<EOF
  629. #include "confdefs.h"
  630. find_stack_direction ()
  631. {
  632.   static char *addr = 0;
  633.   auto char dummy;
  634.   if (addr == 0)
  635.     {
  636.       addr = &dummy;
  637.       return find_stack_direction ();
  638.     }
  639.   else
  640.     return (&dummy > addr) ? 1 : -1;
  641. }
  642. main ()
  643. {
  644.   exit (find_stack_direction() < 0);
  645. }
  646. EOF
  647. eval $compile
  648. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  649.   
  650. {
  651. test -n "$verbose" && \
  652. echo "    defining" STACK_DIRECTION to be 1
  653. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  654. DEFS="$DEFS -DSTACK_DIRECTION=1"
  655. }
  656.  
  657.  
  658. else
  659.   
  660. {
  661. test -n "$verbose" && \
  662. echo "    defining" STACK_DIRECTION to be -1
  663. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  664. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  665. }
  666.  
  667. fi
  668. fi
  669. rm -fr conftest*
  670. fi
  671.  
  672.   ;;
  673. esac
  674.  
  675. # Set default prefixes.
  676. if test -n "$prefix"; then
  677.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  678.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  679. fi
  680. if test -n "$exec_prefix"; then
  681.   prsub="$prsub
  682. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  683. fi
  684. # Quote sed substitution magic chars in DEFS.
  685. cat >conftest.def <<EOF
  686. $DEFS
  687. EOF
  688. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  689. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  690. rm -f conftest.def
  691. # Substitute for predefined variables.
  692.  
  693. trap 'rm -f config.status; exit 1' 1 3 15
  694. echo creating config.status
  695. rm -f config.status
  696. cat > config.status <<EOF
  697. #!/bin/sh
  698. # Generated automatically by configure.
  699. # Run this file to recreate the current configuration.
  700. # This directory was configured as follows,
  701. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  702. #
  703. # $0 $configure_args
  704.  
  705. for arg
  706. do
  707.   case "\$arg" in
  708.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  709.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  710.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  711.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  712.   esac
  713. done
  714.  
  715. trap 'rm -f Makefile; exit 1' 1 3 15
  716. LN_S='$LN_S'
  717. YACC='$YACC'
  718. CC='$CC'
  719. RANLIB='$RANLIB'
  720. INSTALL='$INSTALL'
  721. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  722. INSTALL_DATA='$INSTALL_DATA'
  723. CPP='$CPP'
  724. ALLOCA='$ALLOCA'
  725. LIBS='$LIBS'
  726. srcdir='$srcdir'
  727. DEFS='$DEFS'
  728. prefix='$prefix'
  729. exec_prefix='$exec_prefix'
  730. prsub='$prsub'
  731. extrasub='$extrasub'
  732. EOF
  733. cat >> config.status <<\EOF
  734.  
  735. top_srcdir=$srcdir
  736.  
  737. CONFIG_FILES=${CONFIG_FILES-"Makefile"}
  738. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  739.   srcdir=$top_srcdir
  740.   # Remove last slash and all that follows it.  Not all systems have dirname.
  741.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  742.   if test "$dir" != "$file"; then
  743.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  744.     test ! -d "$dir" && mkdir "$dir"
  745.   fi
  746.   echo creating "$file"
  747.   rm -f "$file"
  748.   comment_str="Generated automatically from `echo $file|sed 's|.*/||'`.in by configure."
  749.   case "$file" in
  750.     *.c | *.h | *.C | *.cc | *.m )  echo "/* $comment_str */" > "$file" ;;
  751.     * )          echo "# $comment_str"     > "$file" ;;
  752.   esac
  753.   sed -e "
  754. $prsub
  755. $extrasub
  756. s%@LN_S@%$LN_S%g
  757. s%@YACC@%$YACC%g
  758. s%@CC@%$CC%g
  759. s%@RANLIB@%$RANLIB%g
  760. s%@INSTALL@%$INSTALL%g
  761. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  762. s%@INSTALL_DATA@%$INSTALL_DATA%g
  763. s%@CPP@%$CPP%g
  764. s%@ALLOCA@%$ALLOCA%g
  765. s%@LIBS@%$LIBS%g
  766. s%@srcdir@%$srcdir%g
  767. s%@DEFS@%$DEFS%
  768. " $top_srcdir/${file}.in >> $file
  769. fi; done
  770.  
  771.  
  772. exit 0
  773. EOF
  774. chmod +x config.status
  775. ${CONFIG_SHELL-/bin/sh} config.status
  776.  
  777.